<?php
/**
 * Description of _signup
 * 
 * @author trongkhoi
 * @since Oct 5, 2013 - 11:09:38 AM
 */
?>
<script>
    var assetDir = '<?php echo $this->assetDir ?>'
</script>
<div class="dropdown-menu dropdown-menu-right register-form" id="register_form">
    <div class="row-fluid">
        <div class="span12 register-form-slogan">
            <?php echo Yii::t('frontend', 'Join The Shampoo Community In A Few Seconds!') ?>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span5 sign-in-icons">
            <div class="vertical-line sign-up"></div>
            <div class="vertical-or sign-up"><?php echo Yii::t('frontend', 'OR') ?></div>
            <div class="vertical-line sign-up second"></div>
            <div class="row-fluid">
                <div class="span12 signup-network">
                    <h5 align="center"><?php echo Yii::t('frontend', 'Sign up using one of your networks:') ?></h5>
                    <div class="clearfix"></div>
                    <div class="row-fluid">
                        <div class="span12 sigup-block">
                            <?php $this->widget('ext.hoauth.widgets.HOAuth'); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="span7">
            <div class="row-fluid">
                <?php
                $model = new UserSignUp('signup-frontend');
                $form = $this->beginWidget('CActiveForm', array(
                    'id' => 'signup-form',
//                    'enableClientValidation' => true,
                    'focus' => array($model, 'email'),
                    'htmlOptions' => array(
                        'onsubmit' => "return false;",
                    ),
                    'action' => NULL
                ));
                ?>
                <?php echo CHtml::hiddenField('ajax', 'signup-form'); ?>
                <?php echo $form->errorSummary($model); ?>
                <div class="span12 signup-wrapper">
                    <h5 align="center"><?php echo Yii::t('frontend', 'Create your account the long way:') ?></h5>
                    <div class="clearfix"></div>
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="control-group">
                                <?php echo $form->labelEx($model, 'firstname', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->textField($model, 'firstname', array('data-toggle'=>"tooltip",
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="control-group">
                                <?php echo $form->labelEx($model, 'lastname', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->textField($model, 'lastname', array(
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="control-group">
                                <?php echo $form->labelEx($model, 'email', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->textField($model, 'email', array(
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="control-group">
                                <?php echo $form->labelEx($model, 'mobile_phone', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->textField($model, 'mobile_phone', array(
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="control-group">
                                <?php echo $form->labelEx($model, 'new_pass', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->passwordField($model, 'new_pass', array(
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="control-group">
                                <label class="control-label"><?php echo Yii::t('frontend', 'Confirm Password') ?></label>

                                <div class="controls">
                                    <?php
                                    echo $form->passwordField($model, 'repassword', array(
                                        'class' => 'input-medium span12'))
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="control-group day-of-birth">
                                <?php echo $form->labelEx($model, 'birthday', array('class' => 'control-label')) ?>
                                <div class="controls">
                                    <?php
                                    echo $form->textField($model, 'birthday', array(
                                        'class' => 'span10 bday-append-1',
                                        'disabled' => true
                                    ))
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid subscrible-sign-up">
                        <?php echo $form->checkBox($model, 'subscribe') ?>
                        <label class="control-label" for="UserSignUp_subscribe"><small><?php echo Yii::t('frontend', "Subscribe to receive Shampoo's latest promotions & updates") ?></small></label>
                    </div>
                    <div class="row-fluid" align="center">
                        <div class="span12">
                            <span class="term-of-service"><?php echo Yii::t('frontend', "By signing up, you agree to Shampoo's {link}",array('{link}'=>CHtml::link(Yii::t('frontend', 'Terms & Conditions'),url('page/index', array('url' => 'terms-conditions'))))) ?>
                            <?php echo Yii::t('frontend', 'including our') ?> <a href="<?php echo Yii::app()->createUrl('frontend/page/index', array('url' => 'privacy-policy')) ?>"><?php echo Yii::t('frontend', 'Privacy Policy') ?></a>.</span>
                            <div class="clearfix-custom-10"></div>
                            <?php
                            echo CHtml::submitButton(Yii::t('frontend', 'Sign Up'), array('class' => 'btn btn-signup pull-right', 'onclick' => 'signup();'));
                            ?>
                        </div>
                    </div>
                </div>
                <?php $this->endWidget(); ?>
            </div>
        </div>
    </div>
</div>
<script>
    $(".bday-append-1").datepicker({
        showOn: "button",
        buttonImage: assetDir + "img/calendar.png",
        buttonImageOnly: true,
        changeMonth: true,
        changeYear: true,
        dateFormat: "dd/M/yy",
        autoclose: true,
        yearRange: "-70:-5"
    });
</script>
